let heatmap;

export function addHeatMap(map) {
    map.plugin(["AMap.Heatmap"], function () {      //加载热力图插件
        heatmap = new AMap.Heatmap(map, {
            radius: 15, //给定半径
            opacity: [0.5, 1],
            gradient: {
                0.5: 'red',
                0.65: 'rgb(0, 255, 0)',
                0.7: '#ffea00',
                0.9: 'red',
                1.0: 'red'
            }
        });
    });
}

export function setHeatData(dataContent) {
    heatmap.setDataSet({
        data: dataContent,
        max: 100
    });
}